<?php require_once('header.php');?>	
	<div id="body">	
		<div id="toolbar">										
			<span><?=anchor('app/index/app', '应用管理', array('class'=>'active'))?></span>			
			&nbsp;&nbsp;|&nbsp;&nbsp; 
			<span><?=anchor('app/index/applib', '策略管理')?></span>			
			&nbsp;&nbsp;|&nbsp;&nbsp; 
			<span><a href="#" onClick="openwindow('<?=$add_app?>','添加<?=$title?>')">添加<?=$title?></a></span>						
			&nbsp;&nbsp;&nbsp;&nbsp; 版本管理 &nbsp;>>&nbsp; <?=$title?>管理 <br />
		</div>	
		<div id="content">
		<table class="data" style="width: 100%; margin: 10px 0;">
			<thead>
		<?php if ($page=='app'):?>
			<tr>
				<th>图标</th>				
				<th>应用标示</th>				
				<th>标题</th>				
				<th>版本</th>				
				<th>操作</th>				
			</tr>
		<?php elseif ($page =='applib'):?>
			<tr>
				<th>策略编号</th>				
				<th>策略名称</th>				
				<th>简介</th>				
				<th>操作</th>				
			</tr>
		<?php endif;?>
			</thead>
		<?php if(!empty($list)):?>
				<?php foreach($list as $k => $item):?>
					<?php if($page=='app'):?>
					<tr class="<?=($k%2)==0?'odd':'even'?>">
						<td><img style="width: 60px; height: 60px;" src="<?=base_url("public/images/".$item['app_icon'])?>" /></td>
						<td><?=$item['app_id']?></td>
						<td><?=$item['app_title']?></td>
						<td>
							<?php if (!empty($item['versions'])):?>
								<?php foreach($item['versions'] as $version):?>
									<span><a href="<?=$version['link']?>">[<?=$version['edition_id']?>]</a></span>&nbsp;
								<?php endforeach;?>
							<?php endif;?>
						</td>
						<td>
							<a href="#" onclick="openwindow('<?=$item['add_app_version']?>', '添加应用版本')">添加版本</a>
							<a href="#" onclick="openwindow('<?=$item['delete_app']?>', '删除应用')" style="color: red; ">删除应用</a>
						</td>
					</tr>
					<?php elseif($page=='applib'):?>						
					<tr class="<?=($k%2)==0?'odd':'even'?>">
						<td><?=$item['applib_id']?></td>
						<td>
							<a href="<?=$item['link']?>"><?=$item['applib_title']?></a>
						</td>
						<td><?=($item['applib_intro'])?$item['applib_intro']: ''?></td>						
						<td><a href="#" onclick="openwindow('<?=$item['delete']?>', '删除策略')">删除策略</a></td>
					</tr>
					<?php endif;?>					
				<?php endforeach;?>
		<?php endif;?>
		</table>
		</div>
	</div>
<?php require_once("footer.php"); ?>